/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package report.letter.members;

import report.batch_list.*;
import template.DefaultReportForm;
import template.RegistrantionPanel;

/**
 *
 * @author User
 */
public class REPMembersAddressListLetter extends DefaultReportForm {

    @Override
    public RegistrantionPanel objectCreator() {
        registrantionPanel = new PCMembersAddressListLetter();
        return registrantionPanel;
    }

    @Override
    public Object initObject(RegistrantionPanel panel) {
        
        return panel.initObject();
    }

    @Override
    protected String setFrameTitle() {
        return FRAME_TITLE;
    }

    @Override
    protected String setReportTitle() {
        return genarateReportTitle();
    }

    @Override
    protected String setReport() {
        return REPORT;
    }

    @Override
    protected String setQuery() {
        return genarateQuery();
    }

    private static final String FRAME_TITLE = "Address To Letter Report";
    private static RegistrantionPanel registrantionPanel;
    private static final String REPORT = "AddressToLetterReport.jasper";

    private String genarateQuery() {
        
        return  "       member.name,\n" +
"               	member.address_line_1,\n" +
"                	member.address_line_2,\n" +
"                	member.address_line_3,\n" +
"                       member.code\n" +
"               from\n" +
"                	member\n" +
"               where\n" +
"                	member.`status` = '"+initObject(registrantionPanel)+"'";
    }

    private String genarateReportTitle() {
        return "Address List of Batch Members - " + initObject(registrantionPanel);
    }
}
